package daos;

public class Manager<T>  {

	protected Class<T> clazz;
	
	public Manager(Class<T> clazz) {
		this.clazz = clazz;
	}

	@SuppressWarnings("unchecked")
	public T get(long key) {
		return (T) SessionManager.createSessionFactory().getCurrentSession().get(clazz,key);
	}

	public void save(T object) {
		SessionManager.createSessionFactory().getCurrentSession().saveOrUpdate(object);
	}
}
